function ami = myAmi( vecA,vecB )
	if length(vecA)~=length(vecB)
		error('Two vectors is not the same length');
	end

	sumA = sum(vecA);
	sumB = sum(vecB);
	sumX = sumA + sumB;
	vecS = vecA + vecB;
	probA = vecA/sumA;
	probB = vecB/sumB;
	probS = vecS/sumX;
	rCount = [sumA/sumX, sumB/sumX];
	prob = [probA;probB];
	
	len = length(vecA);
	
	ami = 0;
	for j=1:2
		for i=1:len
			pResult = rCount(1,j);
			pRangeResult = prob(j,i);
			pRange = probS(1,i);
            temp = 0;
            if pRangeResult ~= 0
                temp = pResult*pRangeResult*log2(pRangeResult/pRange);
            end
			ami = ami + temp;
		end
	end
end

